package com.lovo.middleman.controller;

import com.lovo.middleman.bean.SellCarBean;
import com.lovo.middleman.service.ISellCarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/sellCar")
public class SellCarController {

    @Autowired
    ISellCarService iSellCarService;

    @RequestMapping("/getSellCarBean")
    public List<SellCarBean> getSellCarBean(int userId){
      return   iSellCarService.querySellCarBean(userId);
    }

    @RequestMapping("/addSellCarBeanByStockId")
    public void addSellCarBeanByStockId(int stockId){
        iSellCarService.addSellCarBean(stockId);
    }

    @RequestMapping("/deleteSellCarBeanById")
    public void deleteSellCarBeanById(int sellCarId){
        iSellCarService.deleteSellCarBean(sellCarId);
    }
}
